<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/1/1
 * Time: 17:58
 */
namespace common\sources\read\buyrechargerecord;

use \common\models\craftsman\BuyRechargeRecord;

class BuyRechargeRecordAccess
{
    public function checkRecharge($data) {
        $check = BuyRechargeRecord::find()
            ->select('amount,buy_id,order_id,status')
            ->where(['buy_id' => $data['id'],'order_id' => $data['paycode'],'status' => 2])
            ->asArray()
            ->one();
        return $check;
    }

	/**
	 * getRecordrListInfo 获取买手充值列表
	 * @param $where
	 * @param $orderBy
	 * @param $data
	 * @author 中崋 (1291713293@qq.com)
	 * @date   2019/5/8
	 * @return mixed

	public function getRecordrListInfo($where, $data, $orderBy = " id  desc") {
		$query = BuyPepperRecord::find()
			->select("id,buy_id,amount ,rech_type,expend,income,balance,tran_num,remark,img_url,operatorId,action_type,create_time")
			->where($where)
			->orderBy($orderBy);

		// 使用总数来创建一个分页对象
		$page            = new Pagination(['totalCount' => $query->count(), 'pageSize' => $data['limit']]);
		$result['list']  = $query->offset($page->offset)->limit($page->limit)->asArray()->all();
		$result['count'] = $page->totalCount;
		return $result;
	}*/
}